The present invention relates to an information processing apparatus and method, and more particularly, to an information processing apparatus and method for quickly compressing data such as an image.
According to a compression method complying with JPEG (Joint Photographic Experts Group), compression is performed in unit of square blocks each consisting of plural pixels. Hereinafter such compression method will be referred to as xe2x80x9cblock compression.xe2x80x9d Depending on the type of block compression, there are conditions or limitations in the block size or size of compressed data. Even if there are no logical conditions or limitations in the block compression, the specification of a decoder may add limitations to the block compression. Therefore, to perform compression with top priority on the block compression (hereinafter referred to as xe2x80x9cblock compression is prioritizedxe2x80x9d), original data is read in a specified size and block compression is tested. If the conditions or limitations are fulfilled, the block compression is performed, but if the conditions or limitations are not fulfilled and block compression cannot be performed, block compression is performed by another method, or the block is left uncompressed and processing proceeds to the next block, or data compression is performed by a method other than block compression.
In such case where block compression is prioritized, since another compression method is employed or block compression is skipped for some blocks, the compression rate decreases. Also, the following problems arise.
(1) Determining whether or not block compression is possible is time consuming.
(2) If block compression cannot be performed consecutively for a number of blocks, the time required for determination of block compression is wasted.
(3) Because block compression is prioritized, data portion other than the portion subjected to block compression must be processed in unit of predetermined size (specified block size).
The present invention is made in consideration of the above situation and has as its object to perform high-speed compression processing without deteriorating compression efficiency.
To achieve the above object, the present invention provides an information processing method comprising the steps of: dividing inputted image data into blocks each having a predetermined pixel size; determining whether or not block compression is effective with respect to at least one of the blocks; performing block compression on the block if it is determined that block compression is effective; and performing processing, other than block compression, on the block and at least a predetermined number of blocks subsequent to said block, if it is determined that block compression is not effective.
Furthermore, to achieve the aforementioned object, the present invention provides an information processing apparatus comprising: division means for dividing inputted image data into blocks each having a predetermined pixel size; determination means for determining whether or not block compression is effective with respect to at least one of the blocks; and processing means for performing block compression on the block if it is determined that block compression is effective, or performing processing, other than block compression, on the block and at least a predetermined number of blocks subsequent to said block if it is determined that block compression is not effective.
Other features and advantages of the present invention will be apparent from the following description taken in conjunction with the accompanying drawings, in which like reference characters designate the same or similar parts throughout the figures thereof.